package com.project.service.impl;

import com.project.daos.UserinfoMapper;
import com.project.entity.Users;
import com.project.service.UserinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserinfoServiceImpl implements UserinfoService {

    @Autowired
    private UserinfoMapper userinfoMapper;

    @Override
    public Users getUserinfoByPhone(String telephone) {
        return userinfoMapper.selUserinfoByPhone(telephone);
    }

    @Override
    public Users getUserById(Integer id) {
        return userinfoMapper.selUserinfoById(id);
    }

    @Override
    public Integer updateUserinfo(Users users) {
        return userinfoMapper.updateUserinfo(users);
    }

    @Override
    public Integer addUserinfo(Users users) {
        return userinfoMapper.addUserinfo(users);
    }

    @Override
    public Integer updatePassword(Integer id, String password) {
        return userinfoMapper.updatePassword(id, password);
    }

    @Override
    public Integer deleteUserinfo(Integer user_id) {
        return userinfoMapper.delUserinfo(user_id);
    }

    @Override
    public Integer updUserPhoto(Users users) {
        return userinfoMapper.updUserPhoto(users);
    }
}
